!!! 5
html
    head
        include common/_admin_head
        block meta
    | <!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
    | <!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
    | <!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
    | <!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
    | <!--[if (gt IE 9)|!(IE)]><!-->
    | <body class="">
    | <!--<![endif]-->
    block content
    script(type="text/javascript", src="http://cdn.staticfile.org/jquery/1.9.1/jquery.min.js")
    script(type="text/javascript", src="#{options.cdn_path}/js/bootstrap/js/bootstrap.min.js?v=#{options.site_version}")
    script(type="text/javascript", src="#{options.cdn_path}/js/tipsy/js/jquery.tipsy.min.js?v=#{options.site_version}")
    script(type="text/javascript")
        $("[rel=tooltip]").tooltip();
        $('input').tipsy({gravity: 'w', fade: true, html: true});
        $(function() {
            $('.demo-cancel-click').click(function(){return false;});
            // 更改状态
            $(document).on("click", ".delete_show", function(e){
                var dialog = $.dialog();
                $.post( $(this).attr('href'), function(data) {
                    if(data.status === 2){
                        dialog.content('你没有权限，请联系管理员！').lock().time(2000);
                    } else if( data.status ) {
                        dialog.content('状态更新成功！').lock().time(1000);
                        setTimeout(function(){
                            location.reload();
                        }, 1000);
                    } else {
                        dialog.content('操作失败，请稍后再试！').lock().time(2000);
                    }
                });
                return false;
            });
        });
        function _post(dom, dialog, cb) {
            var $form = $(dom);
            $.post($form.attr('action')
                , $form.serialize()
                , function(data){
                    if (data.status === 2) {
                        dialog.content('你没有权限，请联系管理员！').lock().time(2000);
                    } else {
                        cb(data);
                    }
                }
            );
        }
    block script